import request from '@/config/request'
import type { PageInfo } from '@/config/types'
import type { StudentInfoForm } from '@/config/form'

export default {
  info: () => request.get('/front/student/info'),
  update: (form: StudentInfoForm) => request.post('/front/student/info', form),
  myLessons: (expired: boolean, pageInfo: PageInfo) =>
    request.post('/front/my/lessons/', { expired, ...pageInfo }),
  lessonChapters: (id: number) => request.get(`/front/my/lessons/${id}/chapters`),
  lessonEbooks: (id: number) => request.get(`/front/my/lessons/${id}/ebooks`)
}
